import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from '../views/IndexView.vue'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/LoginView.vue'
import MapboxView from '../views/mapbox/MapboxDrew.vue'
import MapboxGeojson from '../views/mapbox/MapboxGeoJson.vue'
import MapboxPbf from '../views/mapbox/MapboxPbf.vue'
import MapboxMeasure from '../views/mapbox/MapboxMeasure.vue'
import MapboxClustering from '../views/mapbox/MapboxClustering.vue'
import MapboxClustered from '../views/mapbox/MapboxClustered.vue'
import PostgisDensityAnalysis from '../views/mapbox/PostgisDensityAnalysis.vue'
import PostgisAbstractAnalysis from '../views/mapbox/PostgisAbstractAnalysis.vue'
import PostgisInterpolationAnalysis from '../views/mapbox/PostgisInterpolationAnalysis.vue'
import PostgisBufferAnalysis from '../views/mapbox/PostgisBufferAnalysis.vue'
import PostgisPolymerzation from '../views/mapbox/PostgisPolymerzation.vue'
import PostgisTysonPolygon from '../views/mapbox/PostgisTysonPolygon.vue'
import PostgisOutline from '../views/mapbox/PostgisOutline.vue'
import PostgisTrendsSection from '../views/mapbox/PostgisTrendsSection.vue'
import PostgisNearAnalysis from '../views/mapbox/PostgisNearAnalysis.vue'
import PostgisSpaceRelation from '../views/mapbox/PostgisSpaceRelation.vue'
import SurfaceAnalysis from '../views/mapbox/SurfaceAnalysis.vue'
import CesiumView from '../views/cesium/CesiumView.vue'
import CesiumDraw from '../views/cesium/CesiumDraw.vue'
import LoadBaseMap from '../views/cesium/LoadBaseMap.vue'
//  引入Echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

import axios from 'axios'

Vue.prototype.$axios = axios

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
   path:'/login',
   component:LoginView
  },
  {
    path: '/index',
    component: IndexView,
    children:[  
      {
        path:'home',
        component:HomeView
      },
      {
        path:'cesium',
        component:CesiumView
      },
      {
        path:'cesiumdraw',
        component:CesiumDraw
      },
      {
        path:'loadbasemap',
        component:LoadBaseMap
      },
      {
        path:'mapboxdrew',
        component:MapboxView
      },
      {
        path:'mapgeojson',
        component:MapboxGeojson
      },
      {
        path:'mapboxpbf',
        component:MapboxPbf
      },
      {
        path:'mapboxclustering',
        component:MapboxClustering
      },
      {
        path:'mapboxClustered',
        component:MapboxClustered
      },
      {
        path:'postgisDensityAnalysis',
        component:PostgisDensityAnalysis
      },
      {
        path:'postgisAbstractAnalysis',
        component:PostgisAbstractAnalysis
      },
      {
        path:'postgisInterpolationAnalysis',
        component:PostgisInterpolationAnalysis
      },
      {
        path:'postgisBufferAnalysis',
        component:PostgisBufferAnalysis
      },
      {
      path:'postgisPolymerzation',
      component:PostgisPolymerzation		  
      },	
      {
        path:'postgisTysonPolygon',
        component:PostgisTysonPolygon       
      },
      {
        path:'postgisOutline',
        component:PostgisOutline       
      },
      {
        path:'postgisTrendsSection',
        component:PostgisTrendsSection
      },
      {
        path:'postgisNearAnalysis',
        component:PostgisNearAnalysis
      },  
      {
        path:'postgisSpaceRelation',
        component:PostgisSpaceRelation
      },
      {
        path:'surfaceAnalysis',
        component:SurfaceAnalysis
      },
      {
        path:'mapboxmeasure',
        component:MapboxMeasure
      }
    ]
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
